import 'package:distribution_mall_flutter/constant/cf_constant.dart';
import 'package:distribution_mall_flutter/generated/l10n.dart';
import 'package:distribution_mall_flutter/widgets/card.dart';
import 'package:flutter/material.dart';

class ContentKey extends StatelessWidget {
  final EdgeInsets padding = const EdgeInsets.fromLTRB(EdgeConstant.edge15,
      EdgeConstant.edge15, EdgeConstant.edge10, EdgeConstant.edge15);
  final EdgeInsets margin = const EdgeInsets.symmetric(
      horizontal: EdgeConstant.edge20, vertical: EdgeConstant.edge10);

  const ContentKey({super.key});

  Widget columnRender({required String top, required String bottom}) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          top,
          style: const TextStyle(
              color: Color.fromRGBO(73, 73, 73, 1), fontSize: FontConstant.f11),
        ),
        Text(
          bottom,
          style: const TextStyle(
              color: ColorConstant.grey153, fontSize: FontConstant.f11),
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return EPCard(
        padding: padding,
        margin: margin,
        enableClickEffect: true,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              S.of(context).productDetails_key,
              style: const TextStyle(fontSize: FontConstant.f13),
            ),
            columnRender(
              top: S.of(context).productDetails_place,
              bottom: S.of(context).productDetails_fei,
            ),
            columnRender(
                top: S.of(context).productDetails_import,
                bottom: S.of(context).no),
            const Icon(
              Icons.arrow_forward_ios,
              color: ColorConstant.grey114,
              size: 12,
            )
          ],
        ));
  }
}
